createOrNull
Builds picture in picture for canvas, or answers null when this browser has neither feature, or when canvas is not an element of a page (an OffscreenCanvas is not).
Parameters
the HTMLCanvasElement that renderer draws into.
told the window's size while the canvas is in the document window, and the page's size again when it comes back.
played and paused by the buttons of the video element's window.
Builds picture in picture for a canvas that is drawn from somewhere else, such as the page's canvas of a worker player, whose drawing was handed to the worker; or answers null as the other overload does. KitePlayerWorker.pictureInPictureOrNull calls this.
Both features carry a canvas drawn from a worker. Measured in Chromium 141, headless and on a display: the canvas moved into the document window keeps showing each new frame, and a live capture of it plays in the video element's window.
Parameters
the HTMLCanvasElement on the page.
sizes the canvas's drawing buffer, as VideoRenderer.setViewport does: to the window's size while the canvas is in the document window, and back after.
called by the play button of the video element's window.
called by the pause button of the video element's window.